package thread;

public class Demo10 {

    public static void main(String[] args) throws InterruptedException {

        Thread thread = new Thread(()->{
            for(int i = 0;i<3000;i++){
                System.out.println("hello Thread");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });



        thread.start();


        //等待thread进程结束
        thread.join(3000);//等待时间


        System.out.println("hello main");
    }
}